﻿<%@ Page Title="Programmatic creation" Language="C#" MasterPageFile="~/Demo.master"
    Inherits="DemoPage" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        DNA.UI.JQuery.Droppable droppable= DNA.UI.JQuery.Droppable.ApplyTo(DroppablePanel);
        droppable.OnClientDrop = "$(this).addClass('ui-state-highlight').find('p').html('Dropped!');";
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all" style="margin-bottom: 10px;">
        Droppable can apply to more than one WebControls and Html Elements dynaimic on server
        side of using <b>ApplyTo</b> Method. This is a simple way to apply droppable to
        a control or controls.
    </div>
        <style type="text/css">
        .draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
        .droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
    </style>
    <div class="dna-code">
        <demo:Code runat="server" ID="codeView" Language="c#" ShowLines="true">
            <CodeTemplate>
    protected void Page_Load(object sender, EventArgs e)
    {
        DNA.UI.JQuery.Droppable droppable= DNA.UI.JQuery.Droppable.ApplyTo(DroppablePanel);
        droppable.OnClientDrop = "$(this).addClass('ui-state-highlight').find('p').html('Dropped!');";
    }
            </CodeTemplate>
        </demo:Code>
    </div>
    <asp:Panel ID="DraggablePanel" runat="server" CssClass="ui-widget-content draggable">
        <p>
            Drag me to my target</p>
    </asp:Panel>
    <asp:Panel ID="DroppablePanel" runat="server" CssClass="ui-widget-header droppable">
        <p>
            Drop here</p>
    </asp:Panel>
    <DotNetAge:Draggable ID="Draggable1" runat="server">
        <Target TargetID="DraggablePanel" />
    </DotNetAge:Draggable>
    <br />
</asp:Content>
